package aiku.numericalcontroloa.Controller.Die;

import aiku.numericalcontroloa.Base.Utils.Result;
import aiku.numericalcontroloa.Model.Entity.DieBonus;
import aiku.numericalcontroloa.Service.DieBonusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 马文杰
 * @version 1.0
 */
@RestController
@RequestMapping("/dieBonus")
public class DieBonusController {
    @Autowired
    private DieBonusService dieBonusService;

    /**
     * 查询分红比例
     */
    @PostMapping("/getBonus")
    public Result getBonus() {
        return dieBonusService.getBonus();
    }

    /**
     * 修改分红比率
     */
    @PostMapping("/updateBonus")
    public Result updateBonus(@RequestBody DieBonus dieBonus) {
        return dieBonusService.updateBonus(dieBonus);
    }

}
